package file;

import java.util.List;

public enum SettingsDefinition {

	STEREOMODE("StereoMode"),
	CARRADIO("CarRadio"),
	DIALOGUEVOLUME("DialogueVolume"),
	YOURSOUNDSYSTEM("YourSoundSystem"),
	MUSICVOLUME("MusicVolume"),
	SOUNDSYSTEMSIZE("SoundSystemSize"),
	VOLANGUAGE("VOLanguage"),
	AUDIOQUALITY("AudioQuality"),
	VOLUME("Volume"),
	UNDERGROWTHQUALITY("UndergrowthQuality"),
	ANTIALIASINGPOST("AntiAliasingPost"),
	RESOLUTIONWIDTH("ResolutionWidth"),
	RESOLUTIONHERTZ("ResolutionHertz"),
	SHADERQUALITY("ShaderQuality"),
	STEREOCONVERGENCE("StereoConvergence"),
	TERRAINQUALITY("TerrainQuality"),
	RESOLUTIONHEIGHT("ResolutionHeight"),
	VSYNC("VSync"),
	CONTRAST("Contrast"),
	TRANSPARENTSHADOWS("TransparentShadows"),
	SHADOWQUALITY("ShadowQuality"),
	EFFECTSQUALITY("EffectsQuality"),
	FIELDOFVIEW("FieldOfView"),
	BRIGHTNESS("Brightness"),
	AMBIENTOCCLUSION("AmbientOcclusion"),
	ANISOTROPICFILTER("AnisotropicFilter"),
	SCREENSAFEAREAWIDTH("ScreenSafeAreaWidth"),
	TEXTUREQUALITY("TextureQuality"),
	ENLIGHTEN("Enlighten"),
	FULLSCREENSCREEN("FullscreenScreen"),
	STEREOSCOPY("Stereoscopy"),
	MESHQUALITY("MeshQuality"),
	ANTIALIASINGDEFERRED("AntiAliasingDeferred"),
	SCREENSAFEAREAHEIGHT("ScreenSafeAreaHeight"),
	FULLSCREENENABLED("FullscreenEnabled"),
	MOTIONBLURENABLED("MotionBlurEnabled"),
	MESHQUALITYOLD("MeshQualityOld"),
	MOTIONBLUR("MotionBlur"),
	OVERALLGRAPHICSQUALITY("OverallGraphicsQuality"),
	MOUSESENSITIVITY("MouseSensitivity"),
	SCHEME2FLIPCAMERAY("Scheme2FlipCameraY"),
	SCHEME1BUTTONS("Scheme1Buttons"),
	SCHEME0FLIPY("Scheme0FlipY"),
	SCHEME1SENSITIVITY("Scheme1Sensitivity"),
	SCHEME2STICKS("Scheme2Sticks"),
	SCHEME1STICKS("Scheme1Sticks"),
	SCHEME1FLIPY("Scheme1FlipY"),
	SCHEME0SENSITIVITY("Scheme0Sensitivity"),
	SCHEME3FLIPCAMERAY("Scheme3FlipCameraY"),
	SCHEME2BUTTONS("Scheme2Buttons"),
	HOLDBUTTONTOZOOM("HoldButtonToZoom"),
	SCHEME3FLIPY("Scheme3FlipY"),
	SCHEME1FLIPCAMERAY("Scheme1FlipCameraY"),
	MOUSERAWINPUT("MouseRawInput"),
	SCHEME0STICKS("Scheme0Sticks"),
	SCHEME2FLIPY("Scheme2FlipY"),
	SCHEME0FLIPCAMERAY("Scheme0FlipCameraY"),
	SCHEME0BUTTONS("Scheme0Buttons"),
	VIBRATION("Vibration"),
	ENABLESUBTITLES("EnableSubtitles"),
	ALLOWPUNKBUSTER("AllowPunkbuster"),
	PHYSICSQUALITY("PhysicsQuality"),
	ZOOMTOGGLE("ZoomToggle"),
	RELOADHINT("ReloadHint"),
	ANIMATIONQUALITY("AnimationQuality"),
	AIMASSIST("AimAssist"),
	HINTSYSTEM("HintSystem"),
	CROUCHTOGGLE("CrouchToggle");
	
	private final String key;
	private ValueObject[] valueObjects;

	private SettingsDefinition(String key) {
		this.key = key;
	}

	public String getKey() {
		return key;
	}

	public ValueObject[] getValueObjects() {
		return valueObjects;
	}
	
	public static void mapKeysValues(List<ValueObject[]> keysValues) {
		for (SettingsDefinition settingsDef : values()) {
			for (ValueObject[] valueObjects : keysValues) {
				if (valueObjects[0] != null) {
					if (settingsDef.getKey().equals(valueObjects[0].getValue())) {
						settingsDef.setValueObjects(valueObjects);
						break;
					}
				}
			}
		}
	}

	private void setValueObjects(ValueObject[] valueObjects) {
		this.valueObjects = valueObjects;
	}
}
